<!DOCTYPE html>
<html lang="en">
<head>
  
<meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title></title>
  <meta name="viewport" content="initial-scale=1, maximum-scale=1">
  <!-- <link rel="shortcut icon" href="http://favicon.ico"> -->
  <meta name="apple-mobile-web-app-capable" content="yes">
  <meta name="apple-mobile-web-app-status-bar-style" content="black">
  <meta name="viewport" content="width=device-width, height=device-height, user-scalable=no, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0">


  <link rel="stylesheet" href="https://gitee.com/huaflower/ReadBook_CommonFile/raw/master/css/sm.min.css">
  <link rel="stylesheet" href="https://gitee.com/huaflower/ReadBook_CommonFile/raw/master/css/sm-extend.min.css">
  <script type="text/javascript" src="https://gitee.com/huaflower/ReadBook_CommonFile/raw/master/common/common/common.js"></script>
  <style>
    /*修改标题栏颜色*/
    .bar.bar-nav {
      background-color: #1FCA23;
    }

    /*修改标题栏字体颜色*/
    .bar.bar-nav .title {
      color: #fff;
    }
    
     /*修改工具栏背景颜色*/
    .bar.bar-tab {
      background-color: #FEEA4D;
    }
    #pull-left{
      display:inline-block;
      width: 1.5rem;
      padding-top:0.3rem;
      float: left;
    }
    #pull-left img{
      display: block;
      width: 100%;
    }
    #pull-title{
      display: inline-block;
      width: 8.0rem;
      height: 2.2rem;
      line-height: 2.2rem;
      /* float: left; */
      margin-left: calc(50% - 4rem - 1.5rem);
      text-align: center;
      color: #fff;
      font-size: 16px;
    }
    /*主题颜色*/
    .themecolor{
      background-color: #1FCA23;
    }
    /*修改内容区背景色*/
    body{
      background-color:#eeeeee;
    }
    .list-block{
       margin: 2.6rem 0 0.5rem;
    }
    .list-block .item-inner{
      padding: 0.3rem 0;
      -webkit-justify-content:flex-start;
      justify-content:flex-start;
    }
    .item-title{
      width: 56%;
      font-size: 16px;
      text-align: right;
    }
    .item-msg{
      width:30%;
      margin-left:2%;
      color: gray;
      font-size: 14px;
    }
    .item-icon{
      width: 2.0rem;
      height: 2.0rem;
    
    }
    .item-icon img{
      display: block;
      width: 100%;
    }
    #exitbtn{
      display: block;
      width: 90%;
      height:2.0rem;
      line-height: 2.0rem;
      text-align: center;
      border-radius:3px;
      color:#fff;
      font-size: 14px;
      border:0;
      float: left;
      margin:8% 5% 5% 5%;
    }

  </style>
</head>
<body>
  
  <div class="page-group">
    <div class="page">

      <!-- 页面内容区域 -->
      <div class="content">
         <!-- 标题栏 -->
        <header class="bar bar-nav">
           <a href="#" id="pull-left" onclick="backclick()"><img src="https://gitee.com/huaflower/ReadBook_CommonFile/raw/master/img/img/back@2x.png"></a>
           <span id="pull-title">个人资料</span>
        </header>
        <div class="list-block">
          <ul id="parentdesc">
            <!-- <li>
              <div class="item-content">  
                 <div class="item-inner" onclick="modify_names()">
                      <span class="item-msg">姓名</span>
                      <div class="item-title">Tony</div>
                      <div class="item-icon">
                         <img src="https://gitee.com/huaflower/ReadBook_CommonFile/raw/master/img/img/img_more_right.png">
                      </div>
                 </div>
              </div>
            </li>
            <li>
              <div class="item-content">  
                 <div class="item-inner" onclick="student_side()">
                      <span class="item-msg">学生端设置</span>
                      <div class="item-title"></div>
                      <div class="item-icon">
                         <img src="https://gitee.com/huaflower/ReadBook_CommonFile/raw/master/img/img/img_more_right.png">
                      </div>
                 </div>
              </div>
            </li>
 
            <li>
              <div class="item-content">  
                 <div class="item-inner" onclick="newphone()">
                      <span class="item-msg">修改手机号</span>
                      <div class="item-title">13811102323</div>
                      <div class="item-icon">
                         <img src="https://gitee.com/huaflower/ReadBook_CommonFile/raw/master/img/img/img_more_right.png">
                      </div>
                 </div>
              </div>
            </li>
            <li>
              <div class="item-content">  
                 <div class="item-inner" onclick="mailbox_binding()">
                      <span class="item-msg">修改邮箱</span>
                      <div class="item-title">13811102@qq.com</div>
                      <div class="item-icon">
                         <img src="https://gitee.com/huaflower/ReadBook_CommonFile/raw/master/img/img/img_more_right.png">
                      </div>
                 </div>
              </div>
            </li>
            <li>
              <div class="item-content">  
                 <div class="item-inner" onclick="change_password()">
                      <span class="item-msg">修改密码</span>
                      <div class="item-title">*******</div>
                      <div class="item-icon">
                         <img src="https://gitee.com/huaflower/ReadBook_CommonFile/raw/master/img/img/img_more_right.png">
                      </div>
                 </div>
              </div>
            </li> -->

          </ul>
        </div>
        <!-- 退出登录按钮 -->
        <a href="#" id="exitbtn" class="themecolor" onclick="clklogout()">退出登录</a>
      </div>
    </div>
  </div>

  <!-- !-- 固定的js引用，所有的jQuery 要用 $$ 表示 --> 
<script type="text/javascript" src="https://gitee.com/huaflower/ReadBook_CommonFile/raw/master/js/js/jquery-1.11.1.min.js"></script>
<!-- 这一行代码是为了 避免js冲突 -->
<script type="text/javascript">var $$ =jQuery.noConflict();</script>

<script type='text/javascript' src='https://gitee.com/huaflower/ReadBook_CommonFile/raw/master/zepto/zepto/zepto.min.js' charset='utf-8'></script>
<script type='text/javascript' src='https://gitee.com/huaflower/ReadBook_CommonFile/raw/master/js/js/sm.min.js' charset='utf-8'></script>
<!-- <script type='text/javascript' src='https://gitee.com/huaflower/CommonFile/raw/master/js/sm-extend.min.js' charset='utf-8'></script> -->
<script src="https://gitee.com/huaflower/ReadBook_CommonFile/raw/master/js/js/swiper/swiper.min.js"></script>
<script type="text/javascript">

   // 点击返回
   function backclick(){
     native_goto('local/finish');
   }

  // 点击学生端设置
  function student_side(){
    native_goto('local/student_side');
  } 

   // 点击修改姓名
   function modify_names(){
     native_goto('local/modify_namep');
   }

   // 修改手机号
   function newphone(){
    native_goto('local/newphone');
   }

   // 修改邮箱
   function mailbox_binding(){
    native_goto('local/mailbox_binding');
   }

   // 修改密码
   function change_password(){
    native_goto('local/change_password');
   }

  // 点击退出登录
   function clklogout(){
    logout();
   }

   // 退出登录接口
   function logout(){
      var param = {}
      var url = 'apis/logout';
      net_request('get',url,param,logoutSuccessCallBack,errorCallBack);
   }

   // 获取用户信息接口
   function userinfo(){
      var param = {}
      var url = 'apis/userinfo';
      net_request('get',url,param,userinfoSuccessCallBack,errorCallBack);
   }

   // 回调成功函数 退出登录
   function logoutSuccessCallBack(data){
     if (isNotNull(data) && data.success) {
      native_goto('local/loginmine');
     }
   }
    
   // 回调成功函数 用户信息
   function userinfoSuccessCallBack(data){
     if (isNotNull(data) && data.success) {
         var item = data.data;
         var html = '';
         if (isNotNull(item)) {
           html = `
                <li>
                  <div class="item-content">  
                     <div class="item-inner" onclick="modify_names()">
                          <span class="item-msg">姓名</span>
                          <div class="item-title">${item.name}</div>
                          <div class="item-icon">
                             <img src="https://gitee.com/huaflower/ReadBook_CommonFile/raw/master/img/img/img_more_right.png">
                          </div>
                     </div>
                  </div>
                </li>
                <li>
                  <div class="item-content">  
                     <div class="item-inner" onclick="student_side()">
                          <span class="item-msg">学生端设置</span>
                          <div class="item-title"></div>
                          <div class="item-icon">
                             <img src="https://gitee.com/huaflower/ReadBook_CommonFile/raw/master/img/img/img_more_right.png">
                          </div>
                     </div>
                  </div>
                </li>
     
                <li>
                  <div class="item-content">  
                     <div class="item-inner" onclick="newphone()">
                          <span class="item-msg">修改手机号</span>
                          <div class="item-title">${item.mobile}</div>
                          <div class="item-icon">
                             <img src="https://gitee.com/huaflower/ReadBook_CommonFile/raw/master/img/img/img_more_right.png">
                          </div>
                     </div>
                  </div>
                </li>
                <li>
                  <div class="item-content">  
                     <div class="item-inner" onclick="mailbox_binding()">
                          <span class="item-msg">修改邮箱</span>
                          <div class="item-title">${item.email}</div>
                          <div class="item-icon">
                             <img src="https://gitee.com/huaflower/ReadBook_CommonFile/raw/master/img/img/img_more_right.png">
                          </div>
                     </div>
                  </div>
                </li>
                <li>
                  <div class="item-content">  
                     <div class="item-inner" onclick="change_password()">
                          <span class="item-msg">修改密码</span>
                          <div class="item-title">*******</div>
                          <div class="item-icon">
                             <img src="https://gitee.com/huaflower/ReadBook_CommonFile/raw/master/img/img/img_more_right.png">
                          </div>
                     </div>
                  </div>
                </li>
              `;
         }

         $$('#parentdesc').html(html);
      }
   }

   function errorCallBack(data){
    
   }

  function getParams(data){
   // data需要转成json调用 ，函数urlParamParseJson();
     /*var jodata = JSON.parse(data); 
     if(isNotNull(jodata)){//
        
     }*/

}


  //刷新数据
  function refreshData(){
    userinfo();
  }

    // 初始化
    $(function(){
      userinfo();
      $.init();
    });
  </script>
</body>
</html>